package client;

import security.exception.KeyLoadingFailedException;

/**
 * Used to start the Client
 * @author Andreas Mair
 *
 */
public class ClientMain 
{
	/**
	 * @param args
	 */
	public static void main(String[] args) 
	{
            try
            {
		if(args.length==0)
		{
                    Client client=new Client("localhost", "13240", "13241");
                    client.start();
//			System.out.println ("Usage:"); 
//		    System.out.println ("java Client <host> <tcpPort> <udpPort>"); 
		}
		else
		{
			try
			{
				Client client=new Client(args[0],args[1],args[2]);
				client.start();
			}
			catch(NumberFormatException nfx)
			{
				System.out.println("tcpPort and udpPort have to be numeric!");
			}
		}
            }
            catch(KeyLoadingFailedException ex)
            {
                System.out.println(ex.getMessage());
            }
	}
}
